home *** CD-ROM | disk | FTP | other *** search
/ Oh!X 2000 Spring / Oh!X 2000 Spring Special CD-ROM (Japan) (Part 2).7z / Oh!X 2000 Spring Special CD-ROM (Japan) (Part 2).bin / DXF / include / d3dcaps.h < prev    next >
C/C++ Source or Header  |  1999-09-08  |  26KB  |  594 lines

  1. /*==========================================================================;
  2.  *
  3.  *
  4.  *  File:       d3dcaps.h
  5.  *  Content:    Direct3D capabilities include file
  6.  *
  7.  ***************************************************************************/
  8.  
  9. #ifndef _D3DCAPS_H
  10. #define _D3DCAPS_H
  11.  
  12. /*
  13.  *  Pull in DirectDraw include file automatically:
  14.  */
  15. #include "ddraw.h"
  16.  
  17. #ifndef DIRECT3D_VERSION
  18. #define DIRECT3D_VERSION         0x0700
  19. #endif
  20.  
  21. #pragma pack(4)
  22.  
  23. /* Description of capabilities of transform */
  24.  
  25. typedef struct _D3DTRANSFORMCAPS {
  26.     DWORD dwSize;
  27.     DWORD dwCaps;
  28. } D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
  29.  
  30. #define D3DTRANSFORMCAPS_CLIP           0x00000001L /* Will clip whilst transforming */
  31.  
  32. /* Description of capabilities of lighting */
  33.  
  34. typedef struct _D3DLIGHTINGCAPS {
  35.     DWORD dwSize;
  36.     DWORD dwCaps;                   /* Lighting caps */
  37.     DWORD dwLightingModel;          /* Lighting model - RGB or mono */
  38.     DWORD dwNumLights;              /* Number of lights that can be handled */
  39. } D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
  40.  
  41. #define D3DLIGHTINGMODEL_RGB            0x00000001L
  42. #define D3DLIGHTINGMODEL_MONO           0x00000002L
  43.  
  44. #define D3DLIGHTCAPS_POINT              0x00000001L /* Point lights supported */
  45. #define D3DLIGHTCAPS_SPOT               0x00000002L /* Spot lights supported */
  46. #define D3DLIGHTCAPS_DIRECTIONAL        0x00000004L /* Directional lights supported */
  47. #if(DIRECT3D_VERSION < 0x700)
  48. #define D3DLIGHTCAPS_PARALLELPOINT      0x00000008L /* Parallel point lights supported */
  49. #endif
  50. #if(DIRECT3D_VERSION < 0x500)
  51. #define D3DLIGHTCAPS_GLSPOT             0x00000010L /* GL syle spot lights supported */
  52. #endif
  53.  
  54. /* Description of capabilities for each primitive type */
  55.  
  56. typedef struct _D3DPrimCaps {
  57.     DWORD dwSize;
  58.     DWORD dwMiscCaps;                 /* Capability flags */
  59.     DWORD dwRasterCaps;
  60.     DWORD dwZCmpCaps;
  61.     DWORD dwSrcBlendCaps;
  62.     DWORD dwDestBlendCaps;
  63.     DWORD dwAlphaCmpCaps;
  64.     DWORD dwShadeCaps;
  65.     DWORD dwTextureCaps;
  66.     DWORD dwTextureFilterCaps;
  67.     DWORD dwTextureBlendCaps;
  68.     DWORD dwTextureAddressCaps;
  69.     DWORD dwStippleWidth;             /* maximum width and height of */
  70.     DWORD dwStippleHeight;            /* of supported stipple (up to 32x32) */
  71. } D3DPRIMCAPS, *LPD3DPRIMCAPS;
  72.  
  73. /* D3DPRIMCAPS dwMiscCaps */
  74.  
  75. #define D3DPMISCCAPS_MASKPLANES         0x00000001L
  76. #define D3DPMISCCAPS_MASKZ              0x00000002L
  77. #define D3DPMISCCAPS_LINEPATTERNREP     0x00000004L
  78. #define D3DPMISCCAPS_CONFORMANT         0x00000008L
  79. #define D3DPMISCCAPS_CULLNONE           0x00000010L
  80. #define D3DPMISCCAPS_CULLCW             0x00000020L
  81. #define D3DPMISCCAPS_CULLCCW            0x00000040L
  82.  
  83. /* D3DPRIMCAPS dwRasterCaps */
  84.  
  85. #define D3DPRASTERCAPS_DITHER                   0x00000001L
  86. #define D3DPRASTERCAPS_ROP2                     0x00000002L
  87. #define D3DPRASTERCAPS_XOR                      0x00000004L
  88. #define D3DPRASTERCAPS_PAT                      0x00000008L
  89. #define D3DPRASTERCAPS_ZTEST                    0x00000010L
  90. #define D3DPRASTERCAPS_SUBPIXEL                 0x00000020L
  91. #define D3DPRASTERCAPS_SUBPIXELX                0x00000040L
  92. #define D3DPRASTERCAPS_FOGVERTEX                0x00000080L
  93. #define D3DPRASTERCAPS_FOGTABLE                 0x00000100L
  94. #define D3DPRASTERCAPS_STIPPLE                  0x00000200L
  95. #if(DIRECT3D_VERSION >= 0x0500)
  96. #define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT   0x00000400L
  97. #define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L
  98. #define D3DPRASTERCAPS_ANTIALIASEDGES           0x00001000L
  99. #define D3DPRASTERCAPS_MIPMAPLODBIAS            0x00002000L
  100. #define D3DPRASTERCAPS_ZBIAS                    0x00004000L
  101. #define D3DPRASTERCAPS_ZBUFFERLESSHSR           0x00008000L
  102. #define D3DPRASTERCAPS_FOGRANGE                 0x00010000L
  103. #define D3DPRASTERCAPS_ANISOTROPY               0x00020000L
  104. #endif /* DIRECT3D_VERSION >= 0x0500 */
  105. #if(DIRECT3D_VERSION >= 0x0600)
  106. #define D3DPRASTERCAPS_WBUFFER                      0x00040000L
  107. #define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT   0x00080000L
  108. #define D3DPRASTERCAPS_WFOG                         0x00100000L
  109. #define D3DPRASTERCAPS_ZFOG                         0x00200000L
  110. #endif /* DIRECT3D_VERSION >= 0x0600 */
  111.  
  112. /* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
  113.  
  114. #define D3DPCMPCAPS_NEVER               0x00000001L
  115. #define D3DPCMPCAPS_LESS                0x00000002L
  116. #define D3DPCMPCAPS_EQUAL               0x00000004L
  117. #define D3DPCMPCAPS_LESSEQUAL           0x00000008L
  118. #define D3DPCMPCAPS_GREATER             0x00000010L
  119. #define D3DPCMPCAPS_NOTEQUAL            0x00000020L
  120. #define D3DPCMPCAPS_GREATEREQUAL        0x00000040L
  121. #define D3DPCMPCAPS_ALWAYS              0x00000080L
  122.  
  123. /* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
  124.  
  125. #define D3DPBLENDCAPS_ZERO              0x00000001L
  126. #define D3DPBLENDCAPS_ONE               0x00000002L
  127. #define D3DPBLENDCAPS_SRCCOLOR          0x00000004L
  128. #define D3DPBLENDCAPS_INVSRCCOLOR       0x00000008L
  129. #define D3DPBLENDCAPS_SRCALPHA          0x00000010L
  130. #define D3DPBLENDCAPS_INVSRCALPHA       0x00000020L
  131. #define D3DPBLENDCAPS_DESTALPHA         0x00000040L
  132. #define D3DPBLENDCAPS_INVDESTALPHA      0x00000080L
  133. #define D3DPBLENDCAPS_DESTCOLOR         0x00000100L
  134. #define D3DPBLENDCAPS_INVDESTCOLOR      0x00000200L
  135. #define D3DPBLENDCAPS_SRCALPHASAT       0x00000400L
  136. #define D3DPBLENDCAPS_BOTHSRCALPHA      0x00000800L
  137. #define D3DPBLENDCAPS_BOTHINVSRCALPHA   0x00001000L
  138.  
  139. /* D3DPRIMCAPS dwShadeCaps */
  140.  
  141. #define D3DPSHADECAPS_COLORFLATMONO             0x00000001L
  142. #define D3DPSHADECAPS_COLORFLATRGB              0x00000002L
  143. #define D3DPSHADECAPS_COLORGOURAUDMONO          0x00000004L
  144. #define D3DPSHADECAPS_COLORGOURAUDRGB           0x00000008L
  145. #define D3DPSHADECAPS_COLORPHONGMONO            0x00000010L
  146. #define D3DPSHADECAPS_COLORPHONGRGB             0x00000020L
  147.  
  148. #define D3DPSHADECAPS_SPECULARFLATMONO          0x00000040L
  149. #define D3DPSHADECAPS_SPECULARFLATRGB           0x00000080L
  150. #define D3DPSHADECAPS_SPECULARGOURAUDMONO       0x00000100L
  151. #define D3DPSHADECAPS_SPECULARGOURAUDRGB        0x00000200L
  152. #define D3DPSHADECAPS_SPECULARPHONGMONO         0x00000400L
  153. #define D3DPSHADECAPS_SPECULARPHONGRGB          0x00000800L
  154.  
  155. #define D3DPSHADECAPS_ALPHAFLATBLEND            0x00001000L
  156. #define D3DPSHADECAPS_ALPHAFLATSTIPPLED         0x00002000L
  157. #define D3DPSHADECAPS_ALPHAGOURAUDBLEND         0x00004000L
  158. #define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED      0x00008000L
  159. #define D3DPSHADECAPS_ALPHAPHONGBLEND           0x00010000L
  160. #define D3DPSHADECAPS_ALPHAPHONGSTIPPLED        0x00020000L
  161.  
  162. #define D3DPSHADECAPS_FOGFLAT                   0x00040000L
  163. #define D3DPSHADECAPS_FOGGOURAUD                0x00080000L
  164. #define D3DPSHADECAPS_FOGPHONG                  0x00100000L
  165.  
  166. /* D3DPRIMCAPS dwTextureCaps */
  167.  
  168. /*
  169.  * Perspective-correct texturing is supported
  170.  */
  171. #define D3DPTEXTURECAPS_PERSPECTIVE     0x00000001L
  172.  
  173. /*
  174.  * Power-of-2 texture dimensions are required
  175.  */
  176. #define D3DPTEXTURECAPS_POW2            0x00000002L
  177.  
  178. /*
  179.  * Alpha in texture pixels is supported
  180.  */
  181. #define D3DPTEXTURECAPS_ALPHA           0x00000004L
  182.  
  183. /*
  184.  * Color-keyed textures are supported
  185.  */
  186. #define D3DPTEXTURECAPS_TRANSPARENCY    0x00000008L
  187.  
  188. /*
  189.  * obsolete, see D3DPTADDRESSCAPS_BORDER
  190.  */
  191. #define D3DPTEXTURECAPS_BORDER          0x00000010L
  192.  
  193. /*
  194.  * Only square textures are supported
  195.  */
  196. #define D3DPTEXTURECAPS_SQUAREONLY      0x00000020L
  197.  
  198. #if(DIRECT3D_VERSION >= 0x0600)
  199. /*
  200.  * Texture indices are not scaled by the texture size prior
  201.  * to interpolation.
  202.  */
  203. #define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
  204.  
  205. /*
  206.  * Device can draw alpha from texture palettes
  207.  */
  208. #define D3DPTEXTURECAPS_ALPHAPALETTE    0x00000080L
  209.  
  210. /*
  211.  * Device can use non-POW2 textures if:
  212.  *  1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
  213.  *  2) D3DRS_WRAP(N) is zero for this texture's coordinates
  214.  *  3) mip mapping is not enabled (use magnification filter only)
  215.  */
  216. #define D3DPTEXTURECAPS_NONPOW2CONDITIONAL  0x00000100L
  217.  
  218. #endif /* DIRECT3D_VERSION >= 0x0600 */
  219. #if(DIRECT3D_VERSION >= 0x0700)
  220.  
  221. // 0x00000200L unused
  222.  
  223. /*
  224.  * Device can divide transformed texture coordinates by the
  225.  * COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
  226.  */
  227. #define D3DPTEXTURECAPS_PROJECTED  0x00000400L
  228.  
  229. /*
  230.  * Device can do cubemap textures
  231.  */
  232. #define D3DPTEXTURECAPS_CUBEMAP           0x00000800L
  233.  
  234. #define D3DPTEXTURECAPS_COLORKEYBLEND     0x00001000L
  235. #endif /* DIRECT3D_VERSION >= 0x0700 */
  236.  
  237. /* D3DPRIMCAPS dwTextureFilterCaps */
  238.  
  239. #define D3DPTFILTERCAPS_NEAREST         0x00000001L
  240. #define D3DPTFILTERCAPS_LINEAR          0x00000002L
  241. #define D3DPTFILTERCAPS_MIPNEAREST      0x00000004L
  242. #define D3DPTFILTERCAPS_MIPLINEAR       0x00000008L
  243. #define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
  244. #define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
  245.  
  246. #if(DIRECT3D_VERSION >= 0x0600)
  247. /* Device3 Min Filter */
  248. #define D3DPTFILTERCAPS_MINFPOINT       0x00000100L
  249. #define D3DPTFILTERCAPS_MINFLINEAR      0x00000200L
  250. #define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
  251.  
  252. /* Device3 Mip Filter */
  253. #define D3DPTFILTERCAPS_MIPFPOINT       0x00010000L
  254. #define D3DPTFILTERCAPS_MIPFLINEAR      0x00020000L
  255.  
  256. /* Device3 Mag Filter */
  257. #define D3DPTFILTERCAPS_MAGFPOINT         0x01000000L
  258. #define D3DPTFILTERCAPS_MAGFLINEAR        0x02000000L
  259. #define D3DPTFILTERCAPS_MAGFANISOTROPIC   0x04000000L
  260. #define D3DPTFILTERCAPS_MAGFAFLATCUBIC    0x08000000L
  261. #define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L
  262. #endif /* DIRECT3D_VERSION >= 0x0600 */
  263.  
  264. /* D3DPRIMCAPS dwTextureBlendCaps */
  265.  
  266. #define D3DPTBLENDCAPS_DECAL            0x00000001L
  267. #define D3DPTBLENDCAPS_MODULATE         0x00000002L
  268. #define D3DPTBLENDCAPS_DECALALPHA       0x00000004L
  269. #define D3DPTBLENDCAPS_MODULATEALPHA    0x00000008L
  270. #define D3DPTBLENDCAPS_DECALMASK        0x00000010L
  271. #define D3DPTBLENDCAPS_MODULATEMASK     0x00000020L
  272. #define D3DPTBLENDCAPS_COPY             0x00000040L
  273. #if(DIRECT3D_VERSION >= 0x0500)
  274. #define D3DPTBLENDCAPS_ADD              0x00000080L
  275. #endif /* DIRECT3D_VERSION >= 0x0500 */
  276.  
  277. /* D3DPRIMCAPS dwTextureAddressCaps */
  278. #define D3DPTADDRESSCAPS_WRAP           0x00000001L
  279. #define D3DPTADDRESSCAPS_MIRROR         0x00000002L
  280. #define D3DPTADDRESSCAPS_CLAMP          0x00000004L
  281. #if(DIRECT3D_VERSION >= 0x0500)
  282. #define D3DPTADDRESSCAPS_BORDER         0x00000008L
  283. #define D3DPTADDRESSCAPS_INDEPENDENTUV  0x00000010L
  284. #endif /* DIRECT3D_VERSION >= 0x0500 */
  285.  
  286. #if(DIRECT3D_VERSION >= 0x0600)
  287.  
  288. /* D3DDEVICEDESC dwStencilCaps */
  289.  
  290. #define D3DSTENCILCAPS_KEEP     0x00000001L
  291. #define D3DSTENCILCAPS_ZERO     0x00000002L
  292. #define D3DSTENCILCAPS_REPLACE  0x00000004L
  293. #define D3DSTENCILCAPS_INCRSAT  0x00000008L
  294. #define D3DSTENCILCAPS_DECRSAT  0x00000010L
  295. #define D3DSTENCILCAPS_INVERT   0x00000020L
  296. #define D3DSTENCILCAPS_INCR     0x00000040L
  297. #define D3DSTENCILCAPS_DECR     0x00000080L
  298.  
  299. /* D3DDEVICEDESC dwTextureOpCaps */
  300.  
  301. #define D3DTEXOPCAPS_DISABLE                    0x00000001L
  302. #define D3DTEXOPCAPS_SELECTARG1                 0x00000002L
  303. #define D3DTEXOPCAPS_SELECTARG2                 0x00000004L
  304. #define D3DTEXOPCAPS_MODULATE                   0x00000008L
  305. #define D3DTEXOPCAPS_MODULATE2X                 0x00000010L
  306. #define D3DTEXOPCAPS_MODULATE4X                 0x00000020L
  307. #define D3DTEXOPCAPS_ADD                        0x00000040L
  308. #define D3DTEXOPCAPS_ADDSIGNED                  0x00000080L
  309. #define D3DTEXOPCAPS_ADDSIGNED2X                0x00000100L
  310. #define D3DTEXOPCAPS_SUBTRACT                   0x00000200L
  311. #define D3DTEXOPCAPS_ADDSMOOTH                  0x00000400L
  312. #define D3DTEXOPCAPS_BLENDDIFFUSEALPHA          0x00000800L
  313. #define D3DTEXOPCAPS_BLENDTEXTUREALPHA          0x00001000L
  314. #define D3DTEXOPCAPS_BLENDFACTORALPHA           0x00002000L
  315. #define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM        0x00004000L
  316. #define D3DTEXOPCAPS_BLENDCURRENTALPHA          0x00008000L
  317. #define D3DTEXOPCAPS_PREMODULATE                0x00010000L
  318. #define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR     0x00020000L
  319. #define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA     0x00040000L
  320. #define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR  0x00080000L
  321. #define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA  0x00100000L
  322. #define D3DTEXOPCAPS_BUMPENVMAP                 0x00200000L
  323. #define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE        0x00400000L
  324. #define D3DTEXOPCAPS_DOTPRODUCT3                0x00800000L
  325.  
  326. /* D3DDEVICEDESC dwFVFCaps flags */
  327.  
  328. #define D3DFVFCAPS_TEXCOORDCOUNTMASK    0x0000ffffL /* mask for texture coordinate count field */
  329. #define D3DFVFCAPS_DONOTSTRIPELEMENTS   0x00080000L /* Device prefers that vertex elements not be stripped */
  330.  
  331. #endif /* DIRECT3D_VERSION >= 0x0600 */
  332.  
  333. /*
  334.  * Description for a device.
  335.  * This is used to describe a device that is to be created or to query
  336.  * the current device.
  337.  */
  338. typedef struct _D3DDeviceDesc {
  339.     DWORD            dwSize;                 /* Size of D3DDEVICEDESC structure */
  340.     DWORD            dwFlags;                /* Indicates which fields have valid data */
  341.     D3DCOLORMODEL    dcmColorModel;          /* Color model of device */
  342.     DWORD            dwDevCaps;              /* Capabilities of device */
  343.     D3DTRANSFORMCAPS dtcTransformCaps;       /* Capabilities of transform */
  344.     BOOL             bClipping;              /* Device can do 3D clipping */
  345.     D3DLIGHTINGCAPS  dlcLightingCaps;        /* Capabilities of lighting */
  346.     D3DPRIMCAPS      dpcLineCaps;
  347.     D3DPRIMCAPS      dpcTriCaps;
  348.     DWORD            dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
  349.     DWORD            dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
  350.     DWORD            dwMaxBufferSize;        /* Maximum execute buffer size */
  351.     DWORD            dwMaxVertexCount;       /* Maximum vertex count */
  352. #if(DIRECT3D_VERSION >= 0x0500)
  353.     // *** New fields for DX5 *** //
  354.  
  355.     // Width and height caps are 0 for legacy HALs.
  356.     DWORD        dwMinTextureWidth, dwMinTextureHeight;
  357.     DWORD        dwMaxTextureWidth, dwMaxTextureHeight;
  358.     DWORD        dwMinStippleWidth, dwMaxStippleWidth;
  359.     DWORD        dwMinStippleHeight, dwMaxStippleHeight;
  360. #endif /* DIRECT3D_VERSION >= 0x0500 */
  361.  
  362. #if(DIRECT3D_VERSION >= 0x0600)
  363.     // New fields for DX6
  364.     DWORD       dwMaxTextureRepeat;
  365.     DWORD       dwMaxTextureAspectRatio;
  366.     DWORD       dwMaxAnisotropy;
  367.  
  368.     // Guard band that the rasterizer can accommodate
  369.     // Screen-space vertices inside this space but outside the viewport
  370.     // will get clipped properly.
  371.     D3DVALUE    dvGuardBandLeft;
  372.     D3DVALUE    dvGuardBandTop;
  373.     D3DVALUE    dvGuardBandRight;
  374.     D3DVALUE    dvGuardBandBottom;
  375.  
  376.     D3DVALUE    dvExtentsAdjust;
  377.     DWORD       dwStencilCaps;
  378.  
  379.     DWORD       dwFVFCaps;
  380.     DWORD       dwTextureOpCaps;
  381.     WORD        wMaxTextureBlendStages;
  382.     WORD        wMaxSimultaneousTextures;
  383. #endif /* DIRECT3D_VERSION >= 0x0600 */
  384. } D3DDEVICEDESC, *LPD3DDEVICEDESC;
  385.  
  386. #if(DIRECT3D_VERSION >= 0x0700)
  387. typedef struct _D3DDeviceDesc7 {
  388.     DWORD            dwDevCaps;              /* Capabilities of device */
  389.     D3DPRIMCAPS      dpcLineCaps;
  390.     D3DPRIMCAPS      dpcTriCaps;
  391.     DWORD            dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
  392.     DWORD            dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
  393.  
  394.     DWORD       dwMinTextureWidth, dwMinTextureHeight;
  395.     DWORD       dwMaxTextureWidth, dwMaxTextureHeight;
  396.  
  397.     DWORD       dwMaxTextureRepeat;
  398.     DWORD       dwMaxTextureAspectRatio;
  399.     DWORD       dwMaxAnisotropy;
  400.  
  401.     D3DVALUE    dvGuardBandLeft;
  402.     D3DVALUE    dvGuardBandTop;
  403.     D3DVALUE    dvGuardBandRight;
  404.     D3DVALUE    dvGuardBandBottom;
  405.  
  406.     D3DVALUE    dvExtentsAdjust;
  407.     DWORD       dwStencilCaps;
  408.  
  409.     DWORD       dwFVFCaps;
  410.     DWORD       dwTextureOpCaps;
  411.     WORD        wMaxTextureBlendStages;
  412.     WORD        wMaxSimultaneousTextures;
  413.  
  414.     DWORD       dwMaxActiveLights;
  415.     D3DVALUE    dvMaxVertexW;
  416.     GUID        deviceGUID;
  417.  
  418.     WORD        wMaxUserClipPlanes;
  419.     WORD        wMaxVertexBlendMatrices;
  420.  
  421.     DWORD       dwVertexProcessingCaps;
  422.  
  423.     DWORD       dwReserved1;
  424.     DWORD       dwReserved2;
  425.     DWORD       dwReserved3;
  426.     DWORD       dwReserved4;
  427. } D3DDEVICEDESC7, *LPD3DDEVICEDESC7;
  428. #endif /* DIRECT3D_VERSION >= 0x0700 */
  429.  
  430. #define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
  431. #define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7))
  432.  
  433. typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
  434.  
  435. #if(DIRECT3D_VERSION >= 0x0700)
  436. typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID);
  437. #endif /* DIRECT3D_VERSION >= 0x0700 */
  438.  
  439. /* D3DDEVICEDESC dwFlags indicating valid fields */
  440.  
  441. #define D3DDD_COLORMODEL            0x00000001L /* dcmColorModel is valid */
  442. #define D3DDD_DEVCAPS               0x00000002L /* dwDevCaps is valid */
  443. #define D3DDD_TRANSFORMCAPS         0x00000004L /* dtcTransformCaps is valid */
  444. #define D3DDD_LIGHTINGCAPS          0x00000008L /* dlcLightingCaps is valid */
  445. #define D3DDD_BCLIPPING             0x00000010L /* bClipping is valid */
  446. #define D3DDD_LINECAPS              0x00000020L /* dpcLineCaps is valid */
  447. #define D3DDD_TRICAPS               0x00000040L /* dpcTriCaps is valid */
  448. #define D3DDD_DEVICERENDERBITDEPTH  0x00000080L /* dwDeviceRenderBitDepth is valid */
  449. #define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
  450. #define D3DDD_MAXBUFFERSIZE         0x00000200L /* dwMaxBufferSize is valid */
  451. #define D3DDD_MAXVERTEXCOUNT        0x00000400L /* dwMaxVertexCount is valid */
  452.  
  453. /* D3DDEVICEDESC dwDevCaps flags */
  454.  
  455. #define D3DDEVCAPS_FLOATTLVERTEX        0x00000001L /* Device accepts floating point */
  456.                                                     /* for post-transform vertex data */
  457. #define D3DDEVCAPS_SORTINCREASINGZ      0x00000002L /* Device needs data sorted for increasing Z */
  458. #define D3DDEVCAPS_SORTDECREASINGZ      0X00000004L /* Device needs data sorted for decreasing Z */
  459. #define D3DDEVCAPS_SORTEXACT            0x00000008L /* Device needs data sorted exactly */
  460.  
  461. #define D3DDEVCAPS_EXECUTESYSTEMMEMORY  0x00000010L /* Device can use execute buffers from system memory */
  462. #define D3DDEVCAPS_EXECUTEVIDEOMEMORY   0x00000020L /* Device can use execute buffers from video memory */
  463. #define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
  464. #define D3DDEVCAPS_TLVERTEXVIDEOMEMORY  0x00000080L /* Device can use TL buffers from video memory */
  465. #define D3DDEVCAPS_TEXTURESYSTEMMEMORY  0x00000100L /* Device can texture from system memory */
  466. #define D3DDEVCAPS_TEXTUREVIDEOMEMORY   0x00000200L /* Device can texture from device memory */
  467. #if(DIRECT3D_VERSION >= 0x0500)
  468. #define D3DDEVCAPS_DRAWPRIMTLVERTEX     0x00000400L /* Device can draw TLVERTEX primitives */
  469. #define D3DDEVCAPS_CANRENDERAFTERFLIP   0x00000800L /* Device can render without waiting for flip to complete */
  470. #define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
  471. #endif /* DIRECT3D_VERSION >= 0x0500 */
  472. #if(DIRECT3D_VERSION >= 0x0600)
  473. #define D3DDEVCAPS_DRAWPRIMITIVES2         0x00002000L /* Device can support DrawPrimitives2 */
  474. #define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
  475. #define D3DDEVCAPS_DRAWPRIMITIVES2EX       0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
  476. #endif /* DIRECT3D_VERSION >= 0x0600 */
  477. #if(DIRECT3D_VERSION >= 0x0700)
  478. #define D3DDEVCAPS_HWTRANSFORMANDLIGHT     0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
  479. #define D3DDEVCAPS_CANBLTSYSTONONLOCAL     0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
  480. #define D3DDEVCAPS_HWRASTERIZATION         0x00080000L /* Device has HW acceleration for rasterization */
  481.  
  482. /*
  483.  * These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
  484.  */
  485.  
  486. /* device can do texgen */
  487. #define D3DVTXPCAPS_TEXGEN              0x00000001L
  488. /* device can do IDirect3DDevice7 colormaterialsource ops */
  489. #define D3DVTXPCAPS_MATERIALSOURCE7     0x00000002L
  490. /* device can do vertex fog */
  491. #define D3DVTXPCAPS_VERTEXFOG           0x00000004L
  492. /* device can do directional lights */
  493. #define D3DVTXPCAPS_DIRECTIONALLIGHTS   0x00000008L
  494. /* device can do positional lights (includes point and spot) */
  495. #define D3DVTXPCAPS_POSITIONALLIGHTS    0x00000010L
  496. /* device can do local viewer */
  497. #define D3DVTXPCAPS_LOCALVIEWER         0x00000020L
  498.  
  499. #endif /* DIRECT3D_VERSION >= 0x0700 */
  500.  
  501. #define D3DFDS_COLORMODEL        0x00000001L /* Match color model */
  502. #define D3DFDS_GUID              0x00000002L /* Match guid */
  503. #define D3DFDS_HARDWARE          0x00000004L /* Match hardware/software */
  504. #define D3DFDS_TRIANGLES         0x00000008L /* Match in triCaps */
  505. #define D3DFDS_LINES             0x00000010L /* Match in lineCaps  */
  506. #define D3DFDS_MISCCAPS          0x00000020L /* Match primCaps.dwMiscCaps */
  507. #define D3DFDS_RASTERCAPS        0x00000040L /* Match primCaps.dwRasterCaps */
  508. #define D3DFDS_ZCMPCAPS          0x00000080L /* Match primCaps.dwZCmpCaps */
  509. #define D3DFDS_ALPHACMPCAPS      0x00000100L /* Match primCaps.dwAlphaCmpCaps */
  510. #define D3DFDS_SRCBLENDCAPS      0x00000200L /* Match primCaps.dwSourceBlendCaps */
  511. #define D3DFDS_DSTBLENDCAPS      0x00000400L /* Match primCaps.dwDestBlendCaps */
  512. #define D3DFDS_SHADECAPS         0x00000800L /* Match primCaps.dwShadeCaps */
  513. #define D3DFDS_TEXTURECAPS       0x00001000L /* Match primCaps.dwTextureCaps */
  514. #define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
  515. #define D3DFDS_TEXTUREBLENDCAPS  0x00004000L /* Match primCaps.dwTextureBlendCaps */
  516. #define D3DFDS_TEXTUREADDRESSCAPS  0x00008000L /* Match primCaps.dwTextureBlendCaps */
  517.  
  518. /*
  519.  * FindDevice arguments
  520.  */
  521. typedef struct _D3DFINDDEVICESEARCH {
  522.     DWORD               dwSize;
  523.     DWORD               dwFlags;
  524.     BOOL                bHardware;
  525.     D3DCOLORMODEL       dcmColorModel;
  526.     GUID                guid;
  527.     DWORD               dwCaps;
  528.     D3DPRIMCAPS         dpcPrimCaps;
  529. } D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
  530.  
  531. typedef struct _D3DFINDDEVICERESULT {
  532.     DWORD               dwSize;
  533.     GUID                guid;           /* guid which matched */
  534.     D3DDEVICEDESC       ddHwDesc;       /* hardware D3DDEVICEDESC */
  535.     D3DDEVICEDESC       ddSwDesc;       /* software D3DDEVICEDESC */
  536. } D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
  537.  
  538. /*
  539.  * Description of execute buffer.
  540.  */
  541. typedef struct _D3DExecuteBufferDesc {
  542.     DWORD               dwSize;         /* size of this structure */
  543.     DWORD               dwFlags;        /* flags indicating which fields are valid */
  544.     DWORD               dwCaps;         /* capabilities of execute buffer */
  545.     DWORD               dwBufferSize;   /* size of execute buffer data */
  546.     LPVOID              lpData;         /* pointer to actual data */
  547. } D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
  548.  
  549. /* D3DEXECUTEBUFFER dwFlags indicating valid fields */
  550.  
  551. #define D3DDEB_BUFSIZE          0x00000001l     /* buffer size valid */
  552. #define D3DDEB_CAPS             0x00000002l     /* caps valid */
  553. #define D3DDEB_LPDATA           0x00000004l     /* lpData valid */
  554.  
  555. /* D3DEXECUTEBUFFER dwCaps */
  556.  
  557. #define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l     /* buffer in system memory */
  558. #define D3DDEBCAPS_VIDEOMEMORY  0x00000002l     /* buffer in device memory */
  559. #define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
  560.  
  561. #if(DIRECT3D_VERSION >= 0x0700)
  562. typedef struct _D3DDEVINFO_TEXTUREMANAGER {
  563.     BOOL    bThrashing;                 /* indicates if thrashing */
  564.     DWORD   dwApproxBytesDownloaded;    /* Approximate number of bytes downloaded by texture manager */
  565.     DWORD   dwNumEvicts;                /* number of textures evicted */
  566.     DWORD   dwNumVidCreates;            /* number of textures created in video memory */
  567.     DWORD   dwNumTexturesUsed;          /* number of textures used */
  568.     DWORD   dwNumUsedTexInVid;          /* number of used textures present in video memory */
  569.     DWORD   dwWorkingSet;               /* number of textures in video memory */
  570.     DWORD   dwWorkingSetBytes;          /* number of bytes in video memory */
  571.     DWORD   dwTotalManaged;             /* total number of managed textures */
  572.     DWORD   dwTotalBytes;               /* total number of bytes of managed textures */
  573.     DWORD   dwLastPri;                  /* priority of last texture evicted */
  574. } D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER;
  575.  
  576. typedef struct _D3DDEVINFO_TEXTURING {
  577.     DWORD   dwNumLoads;                 /* counts Load() API calls */
  578.     DWORD   dwApproxBytesLoaded;        /* Approximate number bytes loaded via Load() */
  579.     DWORD   dwNumPreLoads;              /* counts PreLoad() API calls */
  580.     DWORD   dwNumSet;                   /* counts SetTexture() API calls */
  581.     DWORD   dwNumCreates;               /* counts texture creates */
  582.     DWORD   dwNumDestroys;              /* counts texture destroys */
  583.     DWORD   dwNumSetPriorities;         /* counts SetPriority() API calls */
  584.     DWORD   dwNumSetLODs;               /* counts SetLOD() API calls */
  585.     DWORD   dwNumLocks;                 /* counts number of texture locks */
  586.     DWORD   dwNumGetDCs;                /* counts number of GetDCs to textures */
  587. } D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING;
  588. #endif /* DIRECT3D_VERSION >= 0x0700 */
  589.  
  590. #pragma pack()
  591.  
  592. #endif /* _D3DCAPS_H_ */
  593.  
  594.